package logger2;


public class LogRecord {
	private static final int stackTraceElementNumber = 4;
	private long time;
	private String logger;
	private String message;
	private Level lvl;
	private String threadName;
	private StackTraceElement stackTraceElement;
	
	private LogRecord(long time, String logger, String message, Level lvl, String threadName, StackTraceElement stackTraceElement) {
		super();
		this.time = time;
		this.logger = logger;
		this.message = message;
		this.lvl = lvl;
		this.threadName = threadName;
		this.stackTraceElement = stackTraceElement;
	}
	
	LogRecord(String logger, String message, Level lvl) {
		this(System.currentTimeMillis(), logger, message, lvl, 
				Thread.currentThread().getName(), Thread.currentThread().getStackTrace()[stackTraceElementNumber]);
	}


	public long getTime() {
		return time;
	}

	public String getLogger() {
		return logger;
	}

	public String getMessage() {
		return message;
	}

	public Level getLvl() {
		return lvl;
	}

	public String getThreadName() {
		return threadName;
	}

	public StackTraceElement getStackTraceElement() {
		return stackTraceElement;
	}

	
	
	
	
}
